﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace BattleThis.Core
{
	/// <summary>
	/// Helper for create custome Hash-Values.
	/// </summary>
	public static class HashHelper
	{
		/// <summary>
		/// Combines the hash of several object to one new.
		/// </summary>
		/// <param name="other">The objects to combine.</param>
		/// <returns></returns>
		public static int CombineHash( params  object[] other )
		{
			if( other == null )throw new ArgumentNullException( "other" );

			var result = 3;
			
			foreach( var item in other )
			{
				result = result ^ item.GetHashCode();
			}

			return result;
		}
	}
}